﻿using System;
using System.Collections.Generic;
using System.Text;

namespace MYTech.Data.Oracle
{
    public class Connect
    {
        public Connect()
        { }

        public Connect(string ip, int port, string serverName, string username, string password)
        {
            this.ServerIP = ip;
            this.ServerPort = port;
            this.ServerName = serverName;
            this.UserName = username;
            this.Password = password;
        }

        /// <summary>
        /// 远程主机IP
        /// </summary>
        public string ServerIP { get; set; }
        /// <summary>
        /// 端口号
        /// </summary>
        public int ServerPort { get; set; }
        /// <summary>
        /// 数据库名
        /// </summary>
        public string ServerName { get; set; }
        /// <summary>
        /// 远程数据库用户名
        /// </summary>
        public string UserName { get; set; }
        /// <summary>
        /// 远程数据库密码
        /// </summary>
        public string Password { get; set; }

        /// <summary>
        /// 数据库连接串
        /// </summary>
        public string ConnStr
        {
            get
            {
                return string.Format("Data Source={0}:{1}/{2};User Id={3};Password={4}", ServerIP, ServerPort, ServerName, UserName, Password);
            }
        }
    }
}
